import Vue from 'vue'
import VueRouter from 'vue-router'
// import HomeView from '@/views/HomeView.vue'
// import HandNote from '@/views/HandNote.vue'
// import SearchFind from '@/views/SearchFind.vue'
// import ClassRoom from '@/views/ClassRoom.vue'
// import MyPage from '@/views/MyPage.vue'
// import PlayVideoview from '@/views/PlayVideoview.vue'
// import NoteDetail from '@/views/NoteDetail.vue'
// import FindDetail from '@/views/FindDetail.vue'
// import SearchPage from '@/views/SearchPage.vue'
// import CreatorIns from '@/views/CreatorIns.vue'
// import UserPage from '@/views/UserPage.vue'
// import eArticalPage from '@/views/eArticalPage.vue'
// import HotSift from '@/views/HotSift.vue'
// import LoginReg from '@/views/LoginReg.vue'
// import AttenTion from '@/views/AttenTion.vue'
Vue.use(VueRouter)
// import { resolve } from 'core-js/fn/promise'


// const routes = [{
//     path: "/",
//     redirect: '/home'
//   },
//   {
//     path: '/home',
//     component: HomeView,
//     meta:{homeNav:true,homechildNav:true},
//     component:resolve=>require(['@/views/HomeView.vue'],resolve)
//   },
//   {
//     path: '/handnote',
//     component: HandNote,
//     meta:{homeNav:true,homechildNav:false},
//     component:resolve=>require(['@/views/HandNote.vue'],resolve)
//   },
//   {
//     path: '/searchfind',
//     component: SearchFind,
//     meta:{homeNav:true,homechildNav:false},
//     component:resolve=>require(['@/views/SearchFind.vue'],resolve)
    
//   },
//   {
//     path: '/classroom',
//     component: ClassRoom,
//     meta:{homeNav:true,homechildNav:false},
//     component:resolve=>require(['@/views/ClassRoom.vue'],resolve)
//   },
//   {
//     path: '/mypage',
//     component: MyPage,
//     meta:{homeNav:true,homechildNav:false},
//     component:resolve=>require(['@/views/MyPage.vue'],resolve)
//   },
//   {
//     path: '/playvideoview',
//     component: PlayVideoview,
//     meta:{homeNav:false,homechildNav:false},
//     component:resolve=>require(['@/views/PlayVideoview.vue'],resolve)
//   },
//   {
//     path: '/notedetail',
//     component: NoteDetail,
//     meta:{homeNav:false,homechildNav:false},
//     component:resolve=>require(['@/views/NoteDetail.vue'],resolve)
//   },
//   {
//     path: '/eartical',
//     component: eArticalPage,
//     meta:{homeNav:false,homechildNav:false},
//     component:resolve=>require(['@/views/eArticalPage.vue'],resolve)
//   },
//   {
//     path: '/hotsift',
//     component: HotSift,
//     meta:{homeNav:false,homechildNav:false},
//     component:resolve=>require(['@/views/HotSift.vue'],resolve)
//   },
//   {
//     path: '/finddetail',
//     component: FindDetail,
//     meta:{homeNav:false,homechildNav:false},
//     component:resolve=>require(['@/views/FindDetail.vue'],resolve)
//   },
//   {
//     path: '/searchpage',
//     component: SearchPage,
//     meta:{homeNav:false,homechildNav:false},
//     component:resolve=>require(['@/views/SearchPage.vue'],resolve)
//   },
//   {
//     path: '/creatorins',
//     component: CreatorIns,
//     meta:{homeNav:false,homechildNav:false},
//     component:resolve=>require(['@/views/CreatorIns.vue'],resolve)
//   },
//   {
//     path: '/userpage',
//     component: UserPage,
//     meta:{homeNav:false,homechildNav:false},
//     component:resolve=>require(['@/views/UserPage.vue'],resolve)
//   },
//   {
//     path: '/loginreg',
//     component: LoginReg,
//     meta:{homeNav:false,homechildNav:false},
//     component:resolve=>require(['@/views/LoginReg.vue'],resolve)
//   },
//   {
//     path: '/attention',
//     component: AttenTion,
//     meta:{homeNav:false,homechildNav:false},
//     component:resolve=>require(['@/views/AttenTion.vue'],resolve)
//   }
// ]

const router = new VueRouter({
  routes:[{
    path: "/",
    redirect: '/home'
  },
  {
    path: '/home',
    meta:{homeNav:true,homechildNav:true},
    component:()=>import('@/views/HomeView.vue')
  },
  {
    path: '/handnote',
    meta:{homeNav:true,homechildNav:false},
    component:()=>import('@/views/HandNote.vue')
  },
  {
    path: '/searchfind',
    meta:{homeNav:true,homechildNav:false},
    component:()=>import('@/views/SearchFind.vue')
    
  },
  {
    path: '/classroom',
    meta:{homeNav:true,homechildNav:false},
    component:()=>import('@/views/ClassRoom.vue')
  },
  {
    path: '/mypage',
    meta:{homeNav:true,homechildNav:false},
    component:()=>import('@/views/MyPage.vue')
  },
  {
    path: '/playvideoview',
    meta:{homeNav:false,homechildNav:false},
    component:()=>import('@/views/PlayVideoview.vue')
  },
  {
    path: '/notedetail',
    meta:{homeNav:false,homechildNav:false},
    component:()=>import('@/views/NoteDetail.vue')
  },
  {
    path: '/eartical',
    meta:{homeNav:false,homechildNav:false},
    component:()=>import('@/views/eArticalPage.vue')
  },
  {
    path: '/hotsift',
    meta:{homeNav:false,homechildNav:false},
    component:()=>import('@/views/HotSift.vue')
  },
  {
    path: '/finddetail',
    meta:{homeNav:false,homechildNav:false},
    component:()=>import('@/views/FindDetail.vue')
  },
  {
    path: '/searchpage',
    meta:{homeNav:false,homechildNav:false},
    component:()=>import('@/views/SearchPage.vue')
  },
  {
    path: '/creatorins',
    meta:{homeNav:false,homechildNav:false},
    component:()=>import('@/views/CreatorIns.vue')
  },
  {
    path: '/userpage',
    meta:{homeNav:false,homechildNav:false},
    component:()=>import('@/views/UserPage.vue')
  },
  {
    path: '/loginreg',
    meta:{homeNav:false,homechildNav:false},
    component:()=>import('@/views/LoginReg.vue')
  },
  {
    path: '/attention',
    meta:{homeNav:false,homechildNav:false},
    component:()=>import('@/views/AttenTion.vue')
  }
],
  scrollBehavior (to, from, savedPosition) {
    return { x: 0, y: 0 }
  }
})

export default router
